<template>
	<view>
		<u-button @click="open">上传图片</u-button>
	</view>
</template>

<script>
	//console.log(111)
	//import ht from './dev.js'
	let ht =null
	export default {
		methods:{
			open(){
				uni.chooseImage({
					success: (res) => {
						let path = res.tempFiles[0].path
						ht.uploadFile({
						
						filePath:path,
						cloudPath:"大文件.png",
						
						}).then(res=>{console.log(res)})
						
						return
						uni.getFileSystemManager()
						.readFile({
								filePath: path,
								encoding: 'base64',
								success: r => {
									let type = path.split('.')[1]
									this.$u.post('https://43634747-759a-489b-aa70-0f55875d9de2.bspapp.com/api/user/upload',{
										file:r.data,
										type:type
									}).then(res=>{
										console.log(res)
									})
								}
						})
						
					}
				})
			}
		},
		onLoad() {
			//ht = require('./devjs.js')
		}
	}
</script>

<style scoped>

</style>